package cn.school.dao;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
//String[] value();
import org.apache.ibatis.annotations.Update;

import cn.shcool.entity.Student;

@Mapper
public interface StudentDao2 {

//	@Select("select * from s_student" + "<script>" + "<where>"
//			+ "<if test=\"name!=null and name!=''\"> and sname like '%${name}%' " + "</if>"
//			+ "<if test=\"tele!=null and tele!=''\">and telephone like concat('%',#{tele},'%') " + "</if>" + "</where>"
//			+ "</script>")
	@Select({ "<script>", "select * from s_student", "<where>",
			"<if test=\"name!=null and name!=''\"> and sname like '%${name}%' ", "</if>",
			"<if test=\"tele!=null and tele!=''\">and telephone like concat('%',#{tele},'%') ", "</if>", "</where>",
			"</script>" })
	public List<Student> search(@Param("name") String name, @Param("tele") String tele);

	@Update("update....")
	public int update(Student s);
}
